from routes.app import db
from sqlalchemy import Integer,BLOB,TIMESTAMP
from sqlalchemy.orm import relationship, Mapped,mapped_column
from datetime import datetime

from sqlalchemy.sql import func
from routes.app import app


class Working(db.Model):
    __tablename__ = 'working'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    uid = db.Column(db.Integer, nullable=False)
    size = db.Column(db.Integer, nullable=False)
    createdat = db.Column(db.DateTime, server_default=db.func.now())
    pathOld = db.Column(db.String(100), nullable=False)
    xmin = db.Column(db.Integer, nullable=False)
    ymin = db.Column(db.Integer, nullable=False)
    xmax = db.Column(db.Integer, nullable=False)
    ymax = db.Column(db.Integer, nullable=False)
    classification = db.Column(db.Integer, nullable=False)
    pathNew = db.Column(db.String(100), nullable=False)

    def getId(self):
        return self.id
    def getUid(self):
        return self.uid
    def getSize(self):
        return self.size
    def getCreatedAt(self):
        return self.createdat
    def getPathOld(self):
        return self.pathOld
    def getXmin(self):
        return self.xmin
    def getYmin(self):
        return self.ymin
    def getXmax(self):
        return self.xmax
    def getYmax(self):
        return self.ymax
    def getClassificaton(self):
        return self.classificaton
    def getPathNew(self):
        return self.pathNew

